<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>document对象</title>
	</head>
	<body>
		
		<script type="text/javascript">
			
			var i = 0;
			
			window.onload = function (){
				
				// document属性
				console.log(document.body);
				console.log(document.domain);
				console.log(document.URL);
				console.log(document.referer);// 从那个页面过来的
				console.log(document.title);
				
				setInterval(function(){
					// 修改背景颜色
					var r = Math.floor(Math.random()*256);
					var g = Math.floor(Math.random()*256);
					var b = Math.floor(Math.random()*256);
					// 背景颜色
					document.body.style.background = "rgb("+r+","+g+","+b+")";
					// document.body.style.color 文字颜色
					
					// 网页标题
					if(i==0)
					{
						document.body.style.background = "rgb("+r+","+g+","+b+")";
						i=1;
					}
					else
					{
						document.title = "(*^▽^*)";
						i=0;
					}
				},1000);
			}
			
		</script>
	</body>
</html>
